package com.moonce.api.model.vo;

import com.moonce.api.util.Pagination;

import java.util.List;

/**
 * @author 马路遥(229010812 @ qq.com)
 * @version V1.0
 * @Title: springmvc-demo
 * @Package com.moonce.api.model.vo
 * @Description: 返回分页样式规范化
 * @Date 2017-12-14 11:30
 */
public class PaginationVO<T> {

    private Integer pageNo;
    private Integer total;// 总记录数
    private Integer totalPage;// 总页数
    private List<T> list;

    public PaginationVO() {}

    public PaginationVO(Pagination<T> pagination) {
        this.pageNo = pagination.getPageNo();
        this.total = pagination.getTotal();
        this.totalPage = pagination.getTotalPage();
        this.list = pagination.getResults();
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
